package org.androidannotations.gradle.view.adapter;

import android.widget.BaseAdapter;

public abstract class BaseListAdapter extends BaseAdapter {

    AdapterData data;

    public AdapterData getData() {
        return data;
    }

    public void setData(AdapterData data) {
        this.data = data;
    }

    @Override
    public int getCount() {
        if (data != null) {
            return data.getCount();
        }
        return 0;
    }

    @Override
    public Object getItem(int position) {
        if (data != null) {
            return data.getItem(position);
        }
        return null;
    }

    @Override
    public long getItemId(int position) {
        if (data != null) {
            data.getItemId(position);
        }
        return 0;
    }
}
